//Level module
//Contains the data for the game's level.

//Function for creating the main game level
function createLevel1(){
	var PW = player.width;
	var pathArray = []; var path;
	var ringEnd;
	var guardPos = [];
	var activeOrbit = TOP_ORBIT;
	
	//Tutorial Tier 1 Orbit 30
	createRingOffset(activeOrbit, COUNTERCLOCKWISE, 600, NORTH+PTA(activeOrbit, 500), TWOPI, "obstacle");
	createEntity(activeOrbit, COUNTERCLOCKWISE, NORTH + PTA(activeOrbit, 700), "bill7");
	createEntity(activeOrbit, COUNTERCLOCKWISE, NORTH + PTA(activeOrbit, 200), "sign2b");
	activeOrbit--;
	//
	
	//Tutorial Tier 2 Orbit 29
	createRingOffset(activeOrbit, COUNTERCLOCKWISE, 600, NORTH+PTA(activeOrbit, 800), TWOPI, "obstacle");
	activeOrbit--;
	//
	
	//Tutorial Tier 3 Orbit 28
	pathArray = []; path = [];
	pathArray.push([NORTH+PTA(activeOrbit, 2000), 4*PW]);
	path = createPathArray(activeOrbit, pathArray);
	createRingPath(activeOrbit, COUNTERCLOCKWISE, path, TWOPI, "obstacle");
	createEntity(activeOrbit, COUNTERCLOCKWISE, path[0][1], "upGuard");
	createEntity(activeOrbit, COUNTERCLOCKWISE, path[0][0] + (path[0][1] - path[0][0])/2, "sign3");
	createEntity(activeOrbit, COUNTERCLOCKWISE, path[0][1] + PTA(activeOrbit, STDOB.width), "downGuard");
	activeOrbit--;
	//
	
	//Tutorial Tier 4 Orbit 27
	createRingOffset(activeOrbit, CLOCKWISE, 600, NORTH+PTA(activeOrbit, 400), TWOPI, "obstacle");
	createEntity(activeOrbit, CLOCKWISE, NORTH-PTA(activeOrbit, 950), "bill1");
	activeOrbit--;
	//
	
	//Tutorial Tier 5 Orbit 26
	createRingOffset(activeOrbit, CLOCKWISE, 600, NORTH+PTA(activeOrbit, 700), TWOPI, "obstacle");
	activeOrbit--;
	//
	
	//Tutorial Tier 6 Orbit 25
	pathArray = []; path = [];
	pathArray.push([NORTHWEST, 3*PW]);
	path = createPathArray(activeOrbit, pathArray);
	createRingPath(activeOrbit, CLOCKWISE, path, TWOPI, "obstacle");
	createEntity(activeOrbit, CLOCKWISE, path[0][0], "upGuard");
	createEntity(activeOrbit, CLOCKWISE, path[0][0] + (path[0][1] - path[0][0])/2, "checkpoint");
	createEntity(activeOrbit, CLOCKWISE, path[0][0] + PTA(activeOrbit, 200), "bill3");
	activeOrbit--;
	//
	
	//Transition Tier Orbit 24
	
	activeOrbit--;
	//
	
	//Tier 1 Orbit 23
	pathArray = []; path = [];
	pathArray.push([EAST - PTA(activeOrbit, 1500), 3*PW]);
	path = createPathArray(activeOrbit, pathArray);
	createRingPath(activeOrbit, COUNTERCLOCKWISE, path, TWOPI, "obstacle");
	createEntity(activeOrbit, COUNTERCLOCKWISE, path[0][1], "upGuard");
	activeOrbit--;
	//
	
	//Tier 2 Orbit 22
	createRingOffset(activeOrbit, CLOCKWISE, 900, PTA(activeOrbit, 150), TWOPI, "backGuard");
	createEntity(activeOrbit, COUNTERCLOCKWISE, path[0][0] + PTA(activeOrbit, 250), "bill4");
	activeOrbit--;
	//
	
	//Tier 3 Orbit 21
	pathArray = []; path = [];
	pathArray.push([EAST - PTA(activeOrbit, 1050), 3*PW]);
	pathArray.push([EAST - PTA(activeOrbit, 150), 4*PW]);
	pathArray.push([EAST + PTA(activeOrbit, 850), 4*PW]);
	path = createPathArray(activeOrbit, pathArray);
	createRingPath(activeOrbit, COUNTERCLOCKWISE, path, TWOPI, "obstacle");
	createEntity(activeOrbit, COUNTERCLOCKWISE, path[0][1], "upGuard");
	createEntity(activeOrbit, COUNTERCLOCKWISE, path[1][1], "downGuard");
	createEntity(activeOrbit, COUNTERCLOCKWISE, path[2][1], "upGuard");
	createEntity(activeOrbit, COUNTERCLOCKWISE, path[2][1] + PTA(activeOrbit, UPEN.width), "downGuard");
	createEntity(activeOrbit, COUNTERCLOCKWISE, path[1][0] + PTA(activeOrbit, 190), "sign4");
	activeOrbit--;
	//
	
	//Tier 4 Orbit 20
	createRingOffset(activeOrbit, CLOCKWISE, 700, PTA(activeOrbit, NORTH+100), TWOPI, "obstacle");
	activeOrbit--;
	//
	
	//Tier 5 Orbit 19
	pathArray = []; path = [];
	pathArray.push( [EAST + PTA(activeOrbit, 1300), 3*PW] );
	pathArray.push( [EAST + PTA(activeOrbit, 3800), 4*PW] );
	pathArray.push( [EAST + PTA(activeOrbit, 4700), 3*PW] );
	path = createPathArray(activeOrbit, pathArray);
	createRingPath(activeOrbit, COUNTERCLOCKWISE, path, TWOPI, "obstacle");
	createEntity(activeOrbit, COUNTERCLOCKWISE, path[0][0] + (path[0][1] - path[0][0])/2, "checkpoint");
	createEntity(activeOrbit, COUNTERCLOCKWISE, path[2][0] + (path[2][1] - path[2][0])/2, "checkpoint");
	createEntity(activeOrbit, COUNTERCLOCKWISE, path[2][1], "upGuard");
	createEntity(activeOrbit, COUNTERCLOCKWISE, path[0][0] + (path[0][1] - path[0][0])/2 - PTA(activeOrbit, STDOB.width), "bill2");
	createEntity(activeOrbit, COUNTERCLOCKWISE, path[2][0] + (path[2][1] - path[2][0])/2 - PTA(activeOrbit, 100), "bill8");
	activeOrbit--;
	//
	
	//Tier 6  Orbit 18
	
	activeOrbit--;
	//
	
	//Tier 7  Orbit 17
	pathArray = []; path = [];

	pathArray.push([EAST + PTA(activeOrbit, 1800), 5*PW]);
	pathArray.push([EAST + PTA(activeOrbit, 2500), 4*PW]);
	pathArray.push([EAST + PTA(activeOrbit, 3200), 3*PW]);
	path = createPathArray(activeOrbit, pathArray);
	ringEnd = path[2][1] + PTA(activeOrbit, 300);
	createEntity(activeOrbit, COUNTERCLOCKWISE, path[1][1], "downGuard");
	createRingPath(activeOrbit, COUNTERCLOCKWISE, path, ringEnd, "obstacle");
	createRingOffset(activeOrbit, COUNTERCLOCKWISE, 1000, ringEnd + PTA(activeOrbit, 100), NORTHWEST, "frontGuard");
	createRingOffset(activeOrbit, COUNTERCLOCKWISE, 1000, ringEnd + PTA(activeOrbit, 500) + PTA(activeOrbit, 100), NORTHWEST, "backGuard");
	createEntity(activeOrbit, COUNTERCLOCKWISE, path[1][0] + (path[1][1] - path[1][0])/2  - PTA(activeOrbit, STDOB.width), "sign2b");
	//createEntity(activeOrbit, COUNTERCLOCKWISE, ringEnd + PTA(activeOrbit, 275), "sign1");
	activeOrbit--;
	//
	
	//Tier 8 Orbit 16
	createRingOffset(activeOrbit, CLOCKWISE, 800, PTA(activeOrbit, - 100), TWOPI, "frontGuard");
	createRingOffset(activeOrbit, CLOCKWISE, 1000, NORTH, TWOPI, "bill5");
	createEntity(activeOrbit, COUNTERCLOCKWISE, path[0][0] + (path[0][1] - path[0][0])/2 + PTA(activeOrbit, 250), "sign2b");
	activeOrbit--;
	//
	
	//Tier 9 Orbit 15
	
	activeOrbit--;
	//
	
	//Tier 10 Orbit 14
	pathArray = [];
	pathArray.push([SOUTHWEST - PTA(activeOrbit, 5000), 5*PW]);
	pathArray.push([NORTHWEST - PTA(activeOrbit, 5000), 5*PW]);
	path = createPathArray(activeOrbit, pathArray);
	createRingPath(activeOrbit, CLOCKWISE, path, TWOPI, "obstacle");
	createEntity(activeOrbit, CLOCKWISE, path[0][1], "upGuard");
	createEntity(activeOrbit, CLOCKWISE, path[1][1], "upGuard");
	createEntity(activeOrbit, CLOCKWISE, path[0][0] + (path[0][1] - path[0][0])/2 - PTA(activeOrbit, STDOB.width), "sign5");
	createEntity(activeOrbit, CLOCKWISE, path[1][0] + (path[1][1] - path[1][0])/2 - PTA(activeOrbit, STDOB.width), "sign5");
	activeOrbit--;
	//
	
	//Tier 11 Orbit 13
	pathArray = [];
	pathArray.push([SOUTHWEST - PTA(activeOrbit, 6200), 7*PW]);
	pathArray.push([NORTHWEST - PTA(activeOrbit, 5400), 7*PW]);
	path = createPathArray(activeOrbit, pathArray);
	createRingPath(activeOrbit, CLOCKWISE, path, TWOPI, "obstacle");
	createEntity(activeOrbit, CLOCKWISE, path[0][0], "downGuard");
	createEntity(activeOrbit, CLOCKWISE, path[0][1], "downGuard");
	createEntity(activeOrbit, CLOCKWISE, path[1][0], "downGuard");
	createEntity(activeOrbit, CLOCKWISE, path[1][1], "downGuard");
	activeOrbit--;
	//
	
	//Tier 12 Orbit 12
	activeOrbit--;
	//
	
	//Tier 13 Orbit 11

	activeOrbit--;
	//
	
	//Tier 14 Orbit 10
	pathArray = []; path = [];
	pathArray.push( [NORTH, 700] );
	pathArray.push( [NORTHEAST, 700] );
	pathArray.push( [EAST, 700] );
	pathArray.push( [SOUTHEAST, 700] );
	pathArray.push( [SOUTH, 700] );
	pathArray.push( [SOUTHWEST, 700] );
	pathArray.push( [WEST, 700] );
	pathArray.push( [NORTHWEST, 700] );
	path = createPathArray(activeOrbit, pathArray);
	createRingPath(activeOrbit, COUNTERCLOCKWISE, path, TWOPI, "obstacle");
	activeOrbit--;
	//
	
	//Tier 15 Orbit 9
	
	activeOrbit--;
	//
	
	//Tier 16 Orbit 8
	pathArray = []; path = [];
	pathArray.push( [NORTH, 700] );
	pathArray.push( [NORTHEAST, 700] );
	pathArray.push( [EAST, 700] );
	pathArray.push( [SOUTHEAST, 700] );
	pathArray.push( [SOUTH, 700] );
	pathArray.push( [SOUTHWEST, 700] );
	pathArray.push( [WEST, 700] );
	pathArray.push( [NORTHWEST, 700] );
	path = createPathArray(activeOrbit, pathArray);
	createRingPath(activeOrbit, COUNTERCLOCKWISE, path, TWOPI, "obstacle");
	activeOrbit--;
	//
	
	//Tier 17 Orbit 7
	createRingOffset(activeOrbit, CLOCKWISE, 500, NORTH, TWOPI, "frontGuard");
	activeOrbit--;
	//
	
	//Tier 18 Orbit 6
	activeOrbit--;
	//
	
	//Tier 19 Orbit 5
	createRingOffset(activeOrbit, COUNTERCLOCKWISE, 500, NORTH, TWOPI, "backGuard");
	activeOrbit--;
	//
	
	//Tier 20 Orbit 4
	var beginBox1 = NORTH-PTA(activeOrbit, 700);
	var endBox1 = NORTH+PTA(activeOrbit, 700);
	createEntity(activeOrbit, CLOCKWISE, beginBox1, "downGuard");
	createEntity(activeOrbit, CLOCKWISE, endBox1, "downGuard");
	createRingOffset(activeOrbit, CLOCKWISE, STDOB.width, beginBox1, endBox1, "obstacle");
	beginBox2 = SOUTH-PTA(activeOrbit, 700);
	endBox2 = SOUTH+PTA(activeOrbit, 700);
	createEntity(activeOrbit, CLOCKWISE, beginBox2, "downGuard");
	createEntity(activeOrbit, CLOCKWISE, endBox2, "downGuard");
	createRingOffset(activeOrbit, CLOCKWISE, STDOB.width, beginBox2, endBox2, "obstacle");
	createEntity(activeOrbit, CLOCKWISE, WEST, "upGuard");
	createEntity(activeOrbit, CLOCKWISE, EAST, "upGuard");
	activeOrbit--;
	
	//Tier 21 Orbit 3
	boss = new Entity(NORTH, activeOrbit, CLOCKWISE, 101, 58, bossSprite);
	activeOrbit--;
	
	//Tier 22 Orbit 2
	
	activeOrbit--;
	
	//Tier 23 Orbit 1
	
	activeOrbit--;
	
	//Tier 24 Orbit 0
	createRingOffset(activeOrbit, COUNTERCLOCKWISE, 500, NORTH, TWOPI, "frontGuard");
	activeOrbit--;
	//**********//
}